<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of histonesPlots_CancervsNormal_Fig4B</title>
  <meta name="keywords" content="histonesPlots_CancervsNormal_Fig4B">
  <meta name="description" content="Comparison of histone modification data between a normal (GM06990) and cancer cell line (K562), over chromosome 7">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../../m2html.css">
</head>
<body>
<a name="_top"></a>
<div><a href="../../index.html">Home</a> &gt;  <a href="../index.html">code</a> &gt; <a href="index.html">examples</a> &gt; histonesPlots_CancervsNormal_Fig4B.m</div>

<!--<table width="100%"><tr><td align="left"><a href="../../index.html"><img alt="<" border="0" src="../../left.png">&nbsp;Master index</a></td>
<td align="right"><a href="index.html">Index for code\examples&nbsp;<img alt=">" border="0" src="../../right.png"></a></td></tr></table>-->

<h1>histonesPlots_CancervsNormal_Fig4B
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="box"><strong>Comparison of histone modification data between a normal (GM06990) and cancer cell line (K562), over chromosome 7</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="box"><strong>function histonesPlots_CancervsNormal_Fig4B </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="fragment"><pre class="comment"> Comparison of histone modification data between a normal (GM06990) and cancer cell line (K562), over chromosome 7

 SYNTAX: [] = histonePlots_CancervsNormal_Fig4B()

 See also assembleHistoneDSforClustering(), assembleHistoneDS()

    DASMiner: DAS library and browser for Matlab.
    Diogo Veiga, Jan 2009.</pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../../matlabicon.gif)">
</ul>
This function is called by:
<ul style="list-style-image:url(../../matlabicon.gif)">
</ul>
<!-- crossreference -->

<h2><a name="_subfunctions"></a>SUBFUNCTIONS <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<ul style="list-style-image:url(../../matlabicon.gif)">
<li><a href="#_sub1" class="code">function [avg_score,absPos,nHits]=readHistoneXML(xmlS)</a></li></ul>
<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function histonesPlots_CancervsNormal_Fig4B</a>
0002 <span class="comment">% Comparison of histone modification data between a normal (GM06990) and cancer cell line (K562), over chromosome 7</span>
0003 <span class="comment">%</span>
0004 <span class="comment">% SYNTAX: [] = histonePlots_CancervsNormal_Fig4B()</span>
0005 <span class="comment">%</span>
0006 <span class="comment">% See also assembleHistoneDSforClustering(), assembleHistoneDS()</span>
0007 <span class="comment">%</span>
0008 <span class="comment">%    DASMiner: DAS library and browser for Matlab.</span>
0009 <span class="comment">%    Diogo Veiga, Jan 2009.</span>
0010 
0011 [xmlS, xml] = executeDASCommand(<span class="string">'http://hgwdev-gencode.cse.ucsc.edu/cgi-bin/das'</span>,<span class="string">'command'</span>, <span class="string">'features'</span>, <span class="string">'DSN'</span>, <span class="string">'hg18'</span>,<span class="string">'chrom'</span>,<span class="string">'7'</span>,<span class="string">'start'</span>,<span class="string">'115404471'</span> <span class="keyword">...</span>
0012     , <span class="string">'stop'</span>, <span class="string">'117281897'</span>, <span class="string">'featuresList'</span>,{<span class="string">'encodeSangerChipH3acK562'</span>});
0013 [avg_score_H3ac_K562] = <a href="#_sub1" class="code" title="subfunction [avg_score,absPos,nHits]=readHistoneXML(xmlS)">readHistoneXML</a>(xmlS);
0014 
0015 [xmlS, xml] = executeDASCommand(<span class="string">'http://hgwdev-gencode.cse.ucsc.edu/cgi-bin/das'</span>,<span class="string">'command'</span>, <span class="string">'features'</span>, <span class="string">'DSN'</span>, <span class="string">'hg18'</span>,<span class="string">'chrom'</span>,<span class="string">'7'</span>,<span class="string">'start'</span>,<span class="string">'115404471'</span> <span class="keyword">...</span>
0016     , <span class="string">'stop'</span>, <span class="string">'117281897'</span>, <span class="string">'featuresList'</span>,{<span class="string">'encodeSangerChipH3ac'</span>});
0017 [avg_score_H3ac] = <a href="#_sub1" class="code" title="subfunction [avg_score,absPos,nHits]=readHistoneXML(xmlS)">readHistoneXML</a>(xmlS);
0018 
0019 [xmlS, xml] = executeDASCommand(<span class="string">'http://hgwdev-gencode.cse.ucsc.edu/cgi-bin/das'</span>,<span class="string">'command'</span>, <span class="string">'features'</span>, <span class="string">'DSN'</span>, <span class="string">'hg18'</span>,<span class="string">'chrom'</span>,<span class="string">'7'</span>,<span class="string">'start'</span>,<span class="string">'115404471'</span> <span class="keyword">...</span>
0020     , <span class="string">'stop'</span>, <span class="string">'117281897'</span>, <span class="string">'featuresList'</span>,{<span class="string">'encodeSangerChipH3K4me3K562'</span>});
0021 [avg_score_H3K4me3_K562] = <a href="#_sub1" class="code" title="subfunction [avg_score,absPos,nHits]=readHistoneXML(xmlS)">readHistoneXML</a>(xmlS);
0022 
0023 [xmlS, xml] = executeDASCommand(<span class="string">'http://hgwdev-gencode.cse.ucsc.edu/cgi-bin/das'</span>,<span class="string">'command'</span>, <span class="string">'features'</span>, <span class="string">'DSN'</span>, <span class="string">'hg18'</span>,<span class="string">'chrom'</span>,<span class="string">'7'</span>,<span class="string">'start'</span>,<span class="string">'115404471'</span> <span class="keyword">...</span>
0024     , <span class="string">'stop'</span>, <span class="string">'117281897'</span>, <span class="string">'featuresList'</span>,{<span class="string">'encodeSangerChipH3K4me3'</span>});
0025 [avg_score_H3K4me3] = <a href="#_sub1" class="code" title="subfunction [avg_score,absPos,nHits]=readHistoneXML(xmlS)">readHistoneXML</a>(xmlS);
0026 
0027                          
0028 <span class="comment">%Transform intensity into [0,1] interval</span>
0029 avg_score = [avg_score_H3ac avg_score_H3ac_K562 avg_score_H3K4me3 avg_score_H3K4me3_K562];
0030 [avg_score] = mapminmax(avg_score',0,1);
0031 avg_score_H3ac = avg_score(1,:);
0032 avg_score_H3ac_K562 = avg_score(2,:);
0033 avg_score_H3K4me3 = avg_score(3,:);
0034 avg_score_H3K4me3_K562 = avg_score(4,:);
0035 
0036 save <span class="string">'histonePlots_data.mat'</span> avg_score_H3ac avg_score_H3ac_K562 <span class="keyword">...</span>
0037                              avg_score_H3K4me3 avg_score_H3K4me3_K562;
0038                          
0039 <span class="comment">%plottools('on')</span>
0040 
0041 hs_cytobands = cytobandread(<span class="string">'hs_cytoBand.txt'</span>);
0042 chromosomeplot(hs_cytobands, 7, <span class="string">'Orientation'</span>, 2, <span class="string">'Unit'</span>, 1);
0043 
0044 subplot(4,1,1);
0045 plot(avg_score_H3ac, <span class="string">'-r'</span>, <span class="string">'DisplayName'</span>, <span class="string">'GM06990 H3ac'</span>, <span class="string">'YDataSource'</span>, <span class="string">'avg_score_H3ac'</span>);
0046 title(<span class="string">'GM06990 H3ac'</span>)
0047 box off
0048 
0049 subplot(4,1,2); 
0050 plot(avg_score_H3ac_K562,  <span class="string">'-r'</span>, <span class="string">'DisplayName'</span>, <span class="string">'avg_score_H3ac_K562'</span>, <span class="string">'YDataSource'</span>, <span class="string">'avg_score_H3ac_K562'</span>);
0051 title(<span class="string">'K562 H3ac'</span>)
0052 box off
0053 
0054 subplot(4,1,3); 
0055 plot(avg_score_H3K4me3, <span class="string">'-b'</span>, <span class="string">'DisplayName'</span>, <span class="string">'avg_score_H3K4me3'</span>, <span class="string">'YDataSource'</span>, <span class="string">'avg_score_H3K4me3'</span>);
0056 title(<span class="string">'GM06990 H3K4me3'</span>)
0057 box off
0058 
0059 subplot(4,1,4); 
0060 plot(avg_score_H3K4me3_K562, <span class="string">'-b'</span>, <span class="string">'DisplayName'</span>, <span class="string">'avg_score_H3K4me3_K562'</span>, <span class="string">'YDataSource'</span>, <span class="string">'avg_score_H3K4me3_K562'</span>);
0061 title(<span class="string">'K562 H3K4me3'</span>)
0062 box off
0063 
0064 
0065 
0066 <a name="_sub1" href="#_subfunctions" class="code">function [avg_score,absPos,nHits]=readHistoneXML(xmlS)</a>
0067 
0068 nFeatures = size(xmlS.GFF{1}.SEGMENT{1}.FEATURE,2);
0069 feat = cell(nFeatures,1);
0070 
0071 chrEnd = 117281897;
0072 chrStart = 115404471;
0073 
0074 absPos = zeros(chrEnd-chrStart+1,1);
0075 <span class="keyword">for</span> i=1:chrEnd-chrStart+1
0076    absPos(i) = i; 
0077 <span class="keyword">end</span>
0078 avg_score = zeros(chrEnd-chrStart+1,1);
0079 nHits = zeros(chrEnd-chrStart+1,1);
0080 
0081 <span class="keyword">for</span> i=1:nFeatures
0082     
0083     <span class="comment">%chipLabel = xmlS.GFF{1}.SEGMENT{1}.FEATURE{i}.METHOD{1}.CONTENT;</span>
0084     start = str2double(xmlS.GFF{1}.SEGMENT{1}.FEATURE{i}.START{1}.CONTENT);
0085     stop = str2double(xmlS.GFF{1}.SEGMENT{1}.FEATURE{i}.END{1}.CONTENT);
0086     score = str2double(xmlS.GFF{1}.SEGMENT{1}.FEATURE{i}.SCORE{1}.CONTENT);
0087     
0088     <span class="keyword">if</span> (start-chrStart) &lt; 0
0089         display(<span class="string">'out fragment'</span>);
0090     <span class="keyword">end</span>
0091     
0092     <span class="keyword">for</span> j=start:stop
0093         
0094         <span class="keyword">if</span> (j &gt; chrEnd) , 
0095             <span class="keyword">continue</span>; 
0096         <span class="keyword">end</span>
0097         <span class="keyword">if</span> (j &lt; chrStart), 
0098             <span class="keyword">continue</span>; 
0099         <span class="keyword">end</span> 
0100             
0101        nHits(j-chrStart+1) = nHits(j-chrStart+1)+1;
0102        avg_score(j-chrStart+1) = (avg_score(j-chrStart+1) + score)/nHits(j-chrStart+1);
0103     <span class="keyword">end</span>
0104 <span class="keyword">end</span>
0105</pre></div>
<hr><address>Generated on Tue 17-Feb-2009 16:59:45 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> &copy; 2003</address>
</body>
</html>